<!--
 * @Author: your name
 * @Date: 2022-03-15 14:53:31
 * @LastEditTime: 2022-03-15 18:51:45
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \geyao\geyao\arguments220315.html
-->
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>arguments</title>
	</head>
	<body>
		<script>
            //arguments 是一个对应于传递给函数的参数的类数组对象。
			//这边的arguments[0]等价于fn
			var length = 10
			function fn() {
				console.log(this.length, 'length')
			}
			var obj = {
				length: 5,
				method: function (fn) {
					console.log(arguments[0], 'arguments')
					//      fn(){
					//     console.log(this.length,"length");
					//   } 'arguments'
					arguments[0]()
				},
			}
			obj.method(fn) //1
		</script>
	</body>
</html>
